package com.itheima.hotle;

import java.util.Objects;

public class Room {
    private Room room;
    /*
      房间编号
      101  102  103  104  105...
       201  202  203 204 205 ....
       301 302 303 304 305 ....
     */
    private int no;
    /*
        房间类型:标准，商务，豪华
     */
    private String type;
    //    房 间 状态:是否有人
    private boolean status;

    //构造方法

    public Room() {

    }

    public Room(int no, String type, boolean status) {
        this.no = no;
        this.type = type;
        this.status = status;
    }

    //get set


    public int getNo() {
        return no;
    }

    public void setNo(int no) {
        this.no = no;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public boolean isStatus() {
        return status;
    }

    public void setStatus(boolean status) {
        this.status = status;
    }

    //toString
    @Override
    public String toString() {
        return "Room{" +
                "房间号no=" + no +
                ", 房间类型（type）='" + type + '\'' +
                ", 房间居住情况（status）=" + (status ? "空闲" : "占用") +
                '}';
    }
    //equals

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Room room = (Room) o;
        return no == room.no;
    }

    @Override
    public int hashCode() {
        return Objects.hash(no);
    }
}
